package com.shiguiwu.springmybatis.spring.transaction.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @description:
 * @author: stone
 * @date: Created by 2022/1/9 11:23
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.transaction.demo
 */
@Service
public class ServiceTxB  extends AbstractServiceTxB<String>{

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Transactional
    public void m2() {

        jdbcTemplate.update("insert into book(book_name) values (?)", "西游记");
        //throw new RuntimeException("异常");

    }

    @Override
    public void setT() {
        System.out.println("aaaa");
    }
}
